Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PP-1507] Present sorts as links with palaceproject.io namespaced sort rels. #2100

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

dbernstein
Copy link
Contributor

@dbernstein dbernstein commented Oct 3, 2024

Description

This is a first pass at the ticket below:

I added two new elements to the terms namespace.

Then I implemented them here for the OPDS 1 feed and OPDS 2 feeds.
I'm adding in new links for sorts based on the new namespace terms while leaving the current approach with facets in place for backward compatibility.

The OPDS2 feed adds a new sort link and removes the old "Sort by" facet group since as far as I know, no one is using the OPDS2 feed.

The new sort links will appear just below the root. The old sorting links formatted using the facet groups will remain in place until we we're ready to remove them. You can expect something like the following:

<feed ... xmlns:palace="http://palaceproject.io/terms/properties/"... >
...
   <link  url="https://link-to-sorted-set-by-x" rel="http://palaceproject.io/terms/rel/sort" title="Sort by X"  />
   <link  url="https://link-to-sorted-set-by-y" rel="http://palaceproject.io/terms/rel/sort" title="Sort by Y"  />
   <link  url="https://link-to-sorted-set-by-z" rel="http://palaceproject.io/terms/rel/sort" title="Sort by Z"  palace:active-sort="true"  />

...
</feed>

I'm not sure if this is the right approach or whether it would be cleaner to do a more extensive refactor.

I'd like feedback on 1) the new terms and how they appear in the feed: is this what the clients would find useful? 2) should I be refactoring the FeedData class to remove the "Sort by" facet group all together? Or should we do that as a later revision once the client apps start using OPDS2?

Motivation and Context

https://ebce-lyrasis.atlassian.net/browse/PP-1507

How Has This Been Tested?

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@dbernstein dbernstein marked this pull request as draft October 3, 2024 19:03
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.72%. Comparing base (7d44fa4) to head (3c6969d).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/palace/manager/feed/serializer/opds2.py 86.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2100   +/-   ##
=======================================
  Coverage   90.72%   90.72%           
=======================================
  Files         351      351           
  Lines       40878    40901   +23     
  Branches     8853     8857    +4     
=======================================
+ Hits        37085    37109   +24     
+ Misses       2486     2484    -2     
- Partials     1307     1308    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbernstein dbernstein force-pushed the PP-1507-do-not-present-sorts-as-facets branch from 16a3dbe to de43c6e Compare October 15, 2024 20:54
Copy link
Member

@jonathangreen jonathangreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. the new terms and how they appear in the feed: is this what the clients would find useful?

I think this question is probably better directed to @io7m and @mauricecarrier7, since they are the ones that will need to use this to implement the new facet design using these feeds. It would probably help them to have some examples of what the feed will look like after these changes.

  1. should I be refactoring the FeedData class to remove the "Sort by" facet group all together? Or should we do that as a later revision once the client apps start using OPDS2?

It does seem like a deeper refactor would make things clearer here. The code is referring to order facets, but with this change we are updating these to be sorts rather then facets.

I'm happy to defer to you if we tackle this now, or if we do this refactoring later once the client apps have this implemented.

@dbernstein
Copy link
Contributor Author

@mauricecarrier7 and @io7m : I've updated the description above to include what you can expect to see in the revised feed re new sorting links. Let me know if the approach I took is going to work for you on the client end. An of course if you'd like me to change anything, don't hold back.

@io7m
Copy link
Contributor

io7m commented Oct 16, 2024

I can't see any obvious reason why this would be a problem.

@mauricecarrier7
Copy link

Same, looks good to me. I'm not clear on the extent of what will need to change when we move to OPDS2, but holding on major refactoring until then sounds like a good approach.

@dbernstein dbernstein marked this pull request as ready for review October 16, 2024 17:31
@dbernstein dbernstein changed the title WIP: Present sorts as links with palaceproject.io namespaced sort rels. [PP-1507] Present sorts as links with palaceproject.io namespaced sort rels. Oct 16, 2024
@dbernstein dbernstein force-pushed the PP-1507-do-not-present-sorts-as-facets branch from dd3a3c2 to 0f01ae1 Compare October 16, 2024 18:20
@dbernstein
Copy link
Contributor Author

I created a follow on ticket to refactor when we remove sorting facets altogether.

@dbernstein dbernstein force-pushed the PP-1507-do-not-present-sorts-as-facets branch from 0f01ae1 to 3c6969d Compare October 16, 2024 21:52
@dbernstein dbernstein merged commit 0fe67cd into main Oct 17, 2024
20 checks passed
@dbernstein dbernstein deleted the PP-1507-do-not-present-sorts-as-facets branch October 17, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants